<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/common/basePath.jsp"%>
<%@ include file="/classes/CommonHelper.class.jsp" %>
<%@ include file="/classes/DBHelper.class.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String guid = getParameter(request,"guid");
	//查询数据
	String sql = "select * from APP_ZSPJ_TYPE where guid = ?";
	Map<String,Object> m = getObject(sql,new Object[]{guid});
	if(null!=m){
		pageContext.setAttribute("m",m);
	}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="../js/jquery-1.7.min.js"></script>
<script type="text/javascript" src="../js/jquery.form.js"></script>
<script type="text/javascript">

function toSubmit(){
	if($("#type_name").val()==""){
		alert("请输入类型名称？");
		return false;
	}
	if($("#order_num").val()==""){
		alert("请输入排序？");
		return false;
	}
	
	var numReg = /^\[1-9]?\d*$/;
	if(numReg.test($("#order_num").val())){
		alert("排序必须位数字！");
		return false;
	}
// 	$("#submit").attr("disabled","disabled");
// 	$("#submit").val("请稍后...");
	return true;
} 
</script>
</head>
<body>
<c:if test="${empty m }">
	数据不存在或被删除
</c:if>
<c:if test="${!empty m }">
<form id="myForm" action="zspj_type_modifydo.class.jsp?r=<%=new Date().getTime()%>" method="post" >
	<table>
		<tr>
			<td>类型名称</td>
			<td><input type="text" name="type_name" id="type_name" value="${m.type_name }" /> </td>
		</tr>
		<tr>
			<td>排序</td>
			<td><input type="text" name="order_num" id="order_num" value="${m.order_num }"/> </td>
		</tr>
		<tr>
			<td>
				<input type="hidden" name="guid" value="${m.guid }" />
			</td>
			<td>
				<input id="submit" type="submit" value="提交" />
				<input type="button" value="回到列表页" onclick="window.location.href='zspj_type_list.jsp?r=<%=new Date().getTime() %>'" />
			</td>
		</tr>
	</table>
</form>
</c:if>
</body>
</html>